#include<iostream>
using namespace std ;


struct int_pair
{
    int_pair(int a ,int b ):a(a),b(b){}
    /* data */
    int a ;
    int b ;
};

void self_add_ptr(int_pair* ip)
{
    ip->a++;
    ip->b++;
}
void self_add_ref(int_pair& ip)
{
    ip.a++;
    ip.b++;
}


int main ()
{
    int_pair ip(0,0);
    self_add_ptr(&ip);
    cout << "pointer self add \n a:"<<ip.a<<"b:"<<ip.b<<endl;
    self_add_ref(ip);
    cout << "reference self add \n a:"<<ip.a<<"b:"<<ip.b<<endl;
}